<?php include(APPPATH.'views/admin/common/header.php'); ?>
        <script language="javascript" type="text/javascript">
			if (window.top!=window.self){
				window.top.location.href='<?php site_url('user/login');?>';
			}
			function  trim(str){
				for(var  i  =  0  ;  i<str.length  &&  str.charAt(i)=="  "  ;  i++  )  ;
				for(var  j  =str.length;  j>0  &&  str.charAt(j-1)=="  "  ;  j--)  ;
				if(i>j)  return  "";  
				return  str.substring(i,j);  
			}
			function posts()
			{
				var username = trim($('#username').val());
				var password = trim($('#password').val());
				if(username == ''){ post_false('用户名不能为空'); return false; }
				if(password == ''){ post_false('密码不能为空');   return false; }
				$.ajax({ 
					type:'post',//可选get   
					url:'<?php echo site_url('admin/user/login');?>',//这里是接收数据的PHP程序   
					data:'username='+username+'&password='+password,//传给PHP的数据，多个参数用&连接   
					dataType:'json',//服务器返回的数据类型 可选XML ,Json jsonp script html text等   
					success:function(msg){
						if(msg.type)
						{ 
							alert(msg.msg);
							post_true();
						}
						else
						{
							alert(msg.msg);
						}
					},   
					error:function(){   
						post_false();
						alert(msg.msg);
						return false;
					}   
				})
				return false;
			}
			function post_true(){
				alert();
				return false;
			}
			function post_false(data){
				alert();
				return false;
			}			
			function respuesta()
			{
				setTimeout("window.location='<?php echo site_url('frame/home');?>'", 0 * 1000);
			}
		</script>
			<div class="row-fluid">
				<div class="span12 center login-header">
					<h2>Welcome to xianxing</h2>
				</div><!--/span-->
			</div><!--/row-->
			
			<div class="row-fluid">
				<div class="well span5 center login-box">
					<div class="alert alert-info">
						Please login with your Username and Password.
					</div>
					<form class="form-horizontal" action="" method="post" onsubmit="return posts();">
						<fieldset>
							<div class="input-prepend" title="Username" data-rel="tooltip">
								<span class="add-on"><i class="icon-user"></i></span><input autofocus class="input-large span10" name="username" id="username" type="text" value="admin" />
							</div>
							<div class="clearfix"></div>

							<div class="input-prepend" title="Password" data-rel="tooltip">
								<span class="add-on"><i class="icon-lock"></i></span><input class="input-large span10" name="password" id="password" type="password" value="admin123456" />
							</div>
							<div class="clearfix"></div>

							<div class="input-prepend">
							<label class="remember" for="remember"><input type="checkbox" id="remember" />Remember me</label>
							</div>
							<div class="clearfix"></div>

							<p class="center span5">
							<button type="submit" class="btn btn-primary">Login</button>
							</p>
						</fieldset>
					</form>
				</div><!--/span-->
			</div><!--/row-->
<?php include(APPPATH.'views/admin/common/footer.php'); ?>